package com.soft.javase.day02.practice.order;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/16
 */
// 测试类
public class Test {
    public static void main(String[] args) {
        User user = new User("张三", "滁州市天长市", "13800138000", 10);

        Goods goods1 = new Goods("iPhone 13", 5999.0, 1, "苹果最新款手机");
        Goods goods2 = new Goods("AirPods Pro", 1299.0, 2, "苹果降噪耳机");
        Goods goods3 = new Goods("MacBook Pro", 12999.0, 1, "苹果笔记本电脑");

        Goods[] orderGoods1 = {goods1, goods2};
        Goods[] orderGoods2 = {goods3};

        user.placeOrder(20220001L, orderGoods1);
        user.placeOrder(20220002L, orderGoods2);

        System.out.println("\n查看用户订单中的商品详情:\n");
        for (int i = 0; i < user.getOrderCount(); i++) {
            user.getOrders()[i].showGoodsDetails();
        }
    }
}
